# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateAttributes do
  @moduledoc """
  Stores information about a certificate.

  ## Attributes

  *   `certificateTemplate` (*type:* `GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateTemplate.t`, *default:* `nil`) - The X.509 extension for CertificateTemplate.
  *   `fingerprint` (*type:* `String.t`, *default:* `nil`) - The encoded certificate fingerprint.
  *   `issuer` (*type:* `String.t`, *default:* `nil`) - The name of the issuer of this certificate.
  *   `serialNumber` (*type:* `String.t`, *default:* `nil`) - Serial number of the certificate, Example: "123456789".
  *   `subject` (*type:* `String.t`, *default:* `nil`) - The subject name of this certificate.
  *   `thumbprint` (*type:* `String.t`, *default:* `nil`) - The certificate thumbprint.
  *   `validationState` (*type:* `String.t`, *default:* `nil`) - Output only. Validation state of this certificate.
  *   `validityExpirationTime` (*type:* `DateTime.t`, *default:* `nil`) - Certificate not valid at or after this timestamp.
  *   `validityStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Certificate not valid before this timestamp.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :certificateTemplate =>
            GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateTemplate.t()
            | nil,
          :fingerprint => String.t() | nil,
          :issuer => String.t() | nil,
          :serialNumber => String.t() | nil,
          :subject => String.t() | nil,
          :thumbprint => String.t() | nil,
          :validationState => String.t() | nil,
          :validityExpirationTime => DateTime.t() | nil,
          :validityStartTime => DateTime.t() | nil
        }

  field(:certificateTemplate,
    as: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateTemplate
  )

  field(:fingerprint)
  field(:issuer)
  field(:serialNumber)
  field(:subject)
  field(:thumbprint)
  field(:validationState)
  field(:validityExpirationTime, as: DateTime)
  field(:validityStartTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateAttributes do
  def decode(value, options) do
    GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateAttributes.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CertificateAttributes do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
